<template>
  <view class="">
    <web-view :src="url"></web-view>

    <u-modal
      v-model="mShow6"
      title="温馨提示"
      content="订单系统收款略有延迟，支付成功后可刷新订单查看结果"
      cancel-text="支付失败"
      confirm-text="支付成功"
      confirm-color="#EB5C02"
      :show-cancel-button="true"
      @confirm="confirmHE"
      @cancel="mShow6 = false"
    >
    </u-modal>
  </view>
</template>

<script>
export default {
  data() {
    return {
      url: '',
      mShow6: false,
      contractid: '',
      dealId: '',
      paytype: '',
    }
  },

  onLoad(option) {
    console.log(1111, option)
    this.dealId = option.dealId
    this.paytype = option.paytype
    this.mShow6 = true
    setTimeout(function () {
      uni.showModal({
        title: '温馨提示',
        content: '订单系统收款略有延迟，支付成功后可刷新订单查看结果',
        confirmColor: '#FBB000',
        success: function (res) {
          console.log(res)
          if (res.confirm) {
            // type 支付方式   paytype 0订单  1保证金
            console.log(this.paytype, this.dealId)
            uni.redirectTo({
              url:
                '/pages_common/pages_me/paySuccess/paySuccess?paytype=' +
                option.paytype +
                '&type=0&id=' +
                option.dealId,
            })
          } else if (res.cancel) {
            uni.redirectTo({
              url:
                '/pages_common/pages_me/paySuccess/paySuccess?paytype=' +
                option.paytype +
                '&type=0&id=' +
                option.dealId,
            })
          }
        },
      })
    }, 2000)

    this.url =
      'https://ztcbs.yzsheng.com/payh5/payh5.html?jump=' +
      option.package +
      '&id=' +
      option.id
    // this.url='https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx211529402053350bf2c6d09e5609bd0000&package=2792896872'
  },
  methods: {
    confirmHE() {},
  },
}
</script>

<style></style>
